<template>
  <div>
      <Header class="head">
         <li class="user" slot="top">
             <img src="images/user.jpg" alt="">
         </li>
         <li slot="top"> <span class="iconfont icon-icon-test" @click="find()"></span></li>
         <li slot="top"><span class="iconfont icon-yuedu"></span></li>
      </Header>
      <Cover></Cover>
      <div class="list">
          <Onecontent v-for="(item) in this.$store.state.indexx.indexInfo" :Key="item.id" :user="item.user" :text="item.text" :mainimg="item.mainimg" :faceimg="item.faceimg" :title="item.title" :details="item.details" ></Onecontent>
      </div>
      <footer>
            <ul class="foot">
                <li><span class="iconfont icon-shouye"></span></li>
                <li><span class="iconfont icon-duoren2" @click="jump_public()"></span></li>
            </ul>
            <Icon>
                <span slot="list" class="iconfont icon-Group-"  v-on:click="fun()"></span>
                <!-- <span  class="icon_list">shuzi</span> -->
            </Icon>
      </footer >
      <!-- <Footer></Footer> -->
  </div>
</template>

<script>
// import {apilink} from "@/api/api.js"
import Onecontent from "@/components/index_content.vue"
import Header from "@/components/index_head.vue"
import Cover from "@/components/index_cover.vue"
// import Footer from "@/components/index_footer.vue"
import Icon from "@/components/all_iconlist.vue"
export default {
    components:{
        Onecontent,
        Header,
        Cover,
        // Footer,
        Icon
    },
    methods:{
        fun(){
            console.log(1)
            this.$router.push("/totals")
        },
        find(){
            this.$router.push("/find")
        },
        jump_public(){
            this.$router.push("/public")
        },
        
    },
    created(){
        // this.$store.dispatch("findinfo")
        },
    mounted(){
        this.$store.dispatch("indexinfo")
        console.log("<hr>")
        console.log(this.$store.state.indexx.indexInfo)
        // let arr=this.$store.state.indexx.indexInfo
        // console.log(arr)
        // arr.forEach((item)=>{
        //     console.log(item)
        // })
        // apilink("/get_index","get").then((ok)=>{
        //     console.log(ok)
        // }).catch((err)=>{
        //     console.log(err)
        // })
    },
}
</script>
 
<style scoped>
.head{
    border-bottom: 1px solid #e3e3e3;
}
.head li{
    /* margin:.10rem .15rem 0 .15rem; */
    float: right;
    font-size: .22rem;
}
.head .user{
    width: .38rem;
    height: .38rem;
    border: 3px solid #fee000;
    border-radius: 50%;
    float:left;
    margin: .05rem 0 0 .15rem ;
    /* margin: 0 0 0 .18rem; */
    text-align: center;
    line-height: .37rem;
}
.head .user img{
    width: .35rem;
    height: .35rem;
    border-radius: 50%;
    /* margin: .1rem 0 0 .1rem; */
}
.head .iconfont{
    display: block;
    /* margin-top: .1rem; */
    font-size: .2rem;
    margin: .15rem .1rem 0;
}
.head .icon-icon-test{

}

.coverimg{
    width: 100%;
}
footer ul{
    height: .4rem;
    width: 100%;
    line-height: .4rem;
    background: #ffffff;
    position: fixed;
    bottom: 0;
    left:0;
    overflow: hidden;
    border-top: 1px solid #e3e3e3;
}
footer ul  li{
    float: left;
}
.icon-Group-{
    display: block;
    line-height: .45rem;
    text-align: center;
    margin-left:.5rem ;
    color: #ffffff;
    font-size: .2rem;
}
.iconfont{
    font-size: .18rem;
    margin: 0 .10rem 0;
}
.icon-shouye{
    font-size: .21rem;
    margin-left: .15rem;
}
</style>